package com.awspaas.user.apps.shhtaerospaceindustrial.guaranteecar;

import java.util.List;
import java.util.Map;

import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener;
import com.actionsoft.bpms.commons.database.ColumnMapRowMapper;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.sdk.local.SDK;
import com.awspaas.user.apps.shhtaerospaceindustrial.util.CoreUtil;

public class driverHandleEvent extends ExecuteListener{
	
	public String getDescription() {
		return "调度已派单，给申请人、驾驶员发企业微信消息。";
	}
	
	@Override
	public void execute(ProcessExecutionContext param) throws Exception {
		
		//获取流程实例ID
		String processInstId = param.getProcessInstance().getId();
		//根据流程实例ID获取任务表内数据
		List<Map<String , Object>> headlist = DBSql.query("SELECT * FROM BO_EU_GUARANTEECAR  WHERE BINDID = ? ", 
				new ColumnMapRowMapper(), new Object[] {processInstId});
		Map<String , Object>  jcbd = headlist.get(0);
		String LICENSENUM = CoreUtil.objToStr(jcbd.get("LICENSENUM"));//派出车辆牌号	
		String updatechepaiSql = "update BO_EU_BZYC_CARDDOCINFO set INMISSION='否' where VEHICLECODE ='" + LICENSENUM + "'";
		DBSql.update(updatechepaiSql);	
	}
}
